<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.hhwy.sso.client.filter.SessionUtil" %>
<%@taglib prefix="shiro"  uri="/WEB-INF/ac.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="${Config.staticURL}plugins/miniui/boot.js" type="text/javascript"></script>
    <script type="text/javascript"src="${Config.staticURL}/lib/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="${Config.staticURL}plugins/miniui/table.css">
    <script src="${Config.basePath}plugins/miniui/fileupload/js/ajaxfileupload.js" type="text/javascript"></script>
    <title> 工程表-详细</title>
</head>

<body class="body">
<form action="" id="form1">
    <div
            style="padding: 2px; border-bottom: 0; border: none; margin-top: 10px; background-color: #fff;">

        <table style="width: 100%; border: none;">
            <tr>

                <td style="width: 100%;"></td>
                <td style="white-space: nowrap;">



                  <shiro:hasPermission name="M0103-edit">
                     <a
                        class="mini-button" iconCls="icon-edit" id="edit" onclick="editData()"
                        plain="true">修改</a>
                      <span class="separator" id="s1"></span>
                   </shiro:hasPermission>

                    <shiro:hasPermission name="M0103-delete">
                        <a class="mini-button" iconCls="icon-remove" id="delete" onclick="confirmDelete()"
                           plain="true">删除</a>
                         <span class="separator" id="s2"></span>
                    </shiro:hasPermission>
                    
                    <shiro:hasPermission name="M0103-commit">
                     <a class="mini-button" iconCls="icon-node" id="commit" onclick="startProcess()"
                                           plain="true">提交</a>
                             <span class="separator" id="s3"></span>
                     </shiro:hasPermission>
                     
                    <a
                        class="mini-button" iconCls="icon-undo" id="return" onclick="goBack()"
                        plain="true">返回</a>


                </td>
            </tr>
        </table>
    </div>
    <table border="0" align="center" cellpadding="0" cellspacing="0" class="tab_form">
        <TBODY>
	        <tr>
	            <td class="title" colspan="4">
	              	  工程表-详细	              	  
	            </td>
	            <input id="id" name="id" class="mini-textbox" style="display:none;"/>
	        </tr>
 			<tr>
			
				<td class="l">
		            	父id
		        </td>
				<td class="r">
				          <input id="parentId" name="parentId"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	工程名称
		        </td>
				<td class="r">
	        			
	          <input id="projectName" name="projectName"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	线路工程名称
		        </td>
				<td class="r">
				          <input id="lineProjectName" name="lineProjectName"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	工程简称
		        </td>
				<td class="r">
	        			
	          <input id="projectShortName" name="projectShortName"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	工程编码
		        </td>
				<td class="r">
				          <input id="projectCode" name="projectCode"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	总承包工程群名称
		        </td>
				<td class="r">
	        			
	          <input id="zcbProjectName" name="zcbProjectName"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	工程性质
		        </td>
				<td class="r">
				          <input id="projectStyle" name="projectStyle"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	工程类型
		        </td>
				<td class="r">
	        			
	          <input id="projectType" name="projectType"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	电压等级
		        </td>
				<td class="r">
				          <input id="vGrade" name="vGrade"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	建设性质
		        </td>
				<td class="r">
	        			
	          <input id="buileStyle" name="buileStyle"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	变电容量
		        </td>
				<td class="r">
				          <input id="tranCount" name="tranCount"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	线路起点
		        </td>
				<td class="r">
	        			
	          <input id="lineStart" name="lineStart"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	线路终点
		        </td>
				<td class="r">
				          <input id="lineEnd" name="lineEnd"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	线路条数
		        </td>
				<td class="r">
	        			
	          <input id="lineCount" name="lineCount"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	主配变台数
		        </td>
				<td class="r">
				          <input id="mainOtherCount" name="mainOtherCount"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	总投资额
		        </td>
				<td class="r">
	        			
	          <input id="totleMoney" name="totleMoney"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	变电投资额
		        </td>
				<td class="r">
				          <input id="tranMoney" name="tranMoney"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	线路投资额
		        </td>
				<td class="r">
	        			
	          <input id="lineMoney" name="lineMoney"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	工程状态
		        </td>
				<td class="r">
				          <input id="projectState" name="projectState"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	是否大跨越工程
		        </td>
				<td class="r">
	        			
	          <input id="isBigCrossProject" name="isBigCrossProject"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	是否创优工程
		        </td>
				<td class="r">
				          <input id="isPerfectProject" name="isPerfectProject"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	是否重点工程
		        </td>
				<td class="r">
	        			
	          <input id="isImportProject" name="isImportProject"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	计划开工日期
		        </td>
				<td class="r">
							<input id="planStartTime" name="planStartTime" allowInput="false" class="mini-datepicker mini-textbox asLabel"/>
			
				            </td>
				<td class="l">
		            	计划竣工日期
		        </td>
				<td class="r">
	        			<input id="planFininshTime" name="planFininshTime"allowInput="false" class="mini-datepicker mini-textbox asLabel"/>
			
				            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	计划投产日期
		        </td>
				<td class="r">
							<input id="panUsedTime" name="panUsedTime" allowInput="false" class="mini-datepicker mini-textbox asLabel"/>
			
				            </td>
				<td class="l">
		            	建设地点
		        </td>
				<td class="r">
	        			
	          <input id="buildPoint" name="buildPoint"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	建设地址
		        </td>
				<td class="r">
				          <input id="buildAddr" name="buildAddr"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	总承包业主单位
		        </td>
				<td class="r">
	        			
	          <input id="managerOrg" name="managerOrg"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	业主项目经理
		        </td>
				<td class="r">
				          <input id="manager" name="manager"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	业主联系电话
		        </td>
				<td class="r">
	        			
	          <input id="tel" name="tel"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	工程附件资料
		        </td>
				<td class="r">
				          <input id="groupId" name="groupId"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	业主单位
		        </td>
				<td class="r">
	        			
	          <input id="yzOrg" name="yzOrg"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	监理单位
		        </td>
				<td class="r">
				          <input id="jlOrg" name="jlOrg"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	施工单位
		        </td>
				<td class="r">
	        			
	          <input id="sgOrg" name="sgOrg"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	工程概况
		        </td>
				<td class="r">
				          <input id="projectIntrduce" name="projectIntrduce"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	录入人
		        </td>
				<td class="r">
	        			
	          <input id="tradePerson" name="tradePerson"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	录入时间
		        </td>
				<td class="r">
							<input id="tradeTime" name="tradeTime" allowInput="false" class="mini-datepicker mini-textbox asLabel"/>
			
				            </td>
				<td class="l">
		            	删除标记位,0未删除，1已删除
		        </td>
				<td class="r">
	        			
	          <input id="deleteFlag" name="deleteFlag"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	备注
		        </td>
				<td class="r">
				          <input id="remark" name="remark"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	线路长度
		        </td>
				<td class="r">
	        			
	          <input id="lineLength" name="lineLength"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
			
				<td class="l">
		            	设计单位
		        </td>
				<td class="r">
				          <input id="sjOrg" name="sjOrg"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	0：总承包工程，1：分工程
		        </td>
				<td class="r">
	        			
	          <input id="isProject" name="isProject"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	

        </TBODY>
    </table>
</form>

<script type="text/javascript">
	var basePath = '${Config.baseURL}';
    mini.parse();
    var form = new mini.Form("#form1");

  //取得跳转的参数 返回JSON格式
    function getRequestArgs() {
        var url = location.search;
        //获取url中"?"符后的字串
        var args = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");

            for (var i = 0; i < strs.length; i++) {
                args[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
            }
        }
        return args;
    }

	//详细页面初始化表单数据
    $.ajax({
        url: "${Config.basePath}demo/"+ getRequestArgs()["id"],
        type: "get",
        async: false,
        success: function (text) {
        console.log(text);
            var data = mini.decode(text);   //反序列化成对象
            form.setData(data);             //设置多个控件数据
        }
    });
    
    
	//删除数据
    function confirmDelete() {
        mini.confirm("确定删除记录吗？", "警告",
            function (action) {
                if (action == "ok") {
                    var url = "${Config.basePath}demo/" + getRequestArgs()["id"];
			        $.ajax({
			            url: url,
			            contentType: "application/json;charset=UTF-8",
			            type: "delete",
			            async: false,
			            success: function (text) {
			                goBack();
			            },
			            error: function (jqXHR, textStatus, errorThrown) {
			            	mini.alert("发生异常，删除数据失败");
			            }
			        });
                } else {
                
                }
            }
        );
    }
    
    //跳转修改页面
    function editData() {
        window.location.href = "${Config.basePath}/view/epc/demo/demoEdit?id=" + getRequestArgs()["id"];

    }
    //返回：跳转列表页面
    function goBack() {
        window.location.href = "${Config.basePath}/view/epc/demo/demoList";
    }
</script>
</body>
</html>